// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env:"cloud2-4gncvam39e2323e9",
})
const db=cloud.database();
// 云函数入口函数
/* 根据当前用户openid从表userALL查询用户信息 */
exports.main = async (event, context) => {
  var res= await db.collection("userState").orderBy('date', 'desc').get();
  return res;
}